package com.honey.solr.daosupport.method;

import com.honey.compilation.java.Method;
import com.honey.compilation.java.Parameter;
import com.honey.generator.java.AbstractClassName;
import com.honey.solr.SolrConstant;
import com.honey.solr.SolrFactory;

public class DeleteById7Method extends AbstractClassName {
	private SolrFactory solrFactory = null;
	
	public DeleteById7Method(SolrFactory solrFactory ){
		this . solrFactory =solrFactory;
	}
	
	public Method createMethod(){
		Method answer = new Method("delete");
		Parameter parameter = new Parameter(solrFactory.getConditionType(),"condition");
		answer.addParameter(parameter);
		answer.addBodyLine("return this.deleteByQuery( this."+SolrConstant.CONDITION_ADAPTERTO_QUERY+"(condition) )");
		answer.setReturnType(SolrConstant.UPDATE_RESPONSE);
		answer.addException(SolrConstant.SOLR_SERVER_EXCEPTION);

		return answer;
	}
}
